﻿using System;

namespace ConsoleCommand.Commands
{
    class BackColorCommand : ICommand
    {
        string color;

        public BackColorCommand(string color){
            this.color=color;
        }

        public object Execute() {
            if(!String.IsNullOrEmpty(color)){
                Console.BackgroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), color, true);
            }
            return Console.BackgroundColor;
        }
    }
}
